package cn.bytengine.stem.functional.invoker;

public class RunnableInvoker implements Runnable {
    private final Invoker invoker;
    private final Object[] args;

    public RunnableInvoker(Invoker invoker, Object[] args) {
        this.invoker = invoker;
        this.args = args;
    }

    @Override
    public void run() {
        try {
            invoker.invoke(args);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
}
